package ResponsibilityChain;

/**
 * @author duanzhizhou
 * @date 2024/11/5
 */
public class CommonManager extends Manager{
    
    public CommonManager(String name) {
        super(name);
    }
    
    @Override
    protected void handle(BizRequest request) {
        if ("请假".equals(request.getType()) && request.getNum() <= 2) {
            System.out.println(getName() + ": 批准" + request.getContent() + request.getNum() + "天");
        } else {
            if (getSuccesor() != null) {
                getSuccesor().handle(request);
            } else {
                System.out.println("无法处理的请求");
            }
        }
    }
}
